<?php
	chong_pha_hoai();
?>
<?php
	if($_POST['dangnhap_admin']=="dangnhap_admin")
	{
		if($_POST['ky_danh']!="" and $_POST['mat_khau']!="")
		{
			$kd=$_POST['ky_danh'];
			$mk=$_POST['mat_khau'];
			//$tv="select count(*) from admin where ky_danh='$kd' and mat_khau='$mk' and isActive=1";
			$tv="select * from admin where ky_danh='$kd' and mat_khau='$mk' and isActive=1";
			$tv_1=mysql_query($tv);
			$tv_2=mysql_fetch_row($tv_1);
			if($tv_2!=0)
			{
				$_SESSION['ky_danh_hhh']=$kd;
				$_SESSION['mat_khau_hhh']=$mk;
			}
			else
			{
				thongbao("Sai ký danh hoặc mật khẩu");
			}
		}
		else
		{
			thongbao("Không được bỏ trống ký danh hoặc mật khẩu");
		}
		trangtruoc();
		exit();
	}
	$kd_ccc=$_SESSION['ky_danh_hhh'];
	$mk_ccc=$_SESSION['mat_khau_hhh'];
	if($kd_ccc!="" and $mk_ccc!="")
	{
		//$tv="select count(*) from admin where ky_danh='$kd_ccc' and mat_khau='$mk_ccc' and isActive=1";
		$tv="select * from admin where ky_danh='$kd_ccc' and mat_khau='$mk_ccc' and isActive=1";
		$tv_1=mysql_query($tv);
		$tv_2=mysql_fetch_row($tv_1);
		if($tv_2!=0)
		{
			$xacdinh_dangnhap="co";
		}
	}
	else
	{
		$xacdinh_dangnhap="khong";
	}
?>